"""
文件备份：将南波万账单保存到 D:/Python code/bill.txt
删除测试行并保存到bill.txt.bat
"""

f = open("D:/python code/bill.txt","r",encoding="UTF-8")
new_f = open("D:/python code/bill2.txt","a",encoding="UTF-8")
for line in f:
    words = line.strip("\n").split(",")
    print(words)
    if words[4] == "测试":
        continue
    new_f.write(line)
    new_f.flush()
f.close()
new_f.close()